package com.google.codejam.qua2013.treasure;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;

public class Chest {

    public int               index         = 0;
    public String            entryKey      = null;
    public ArrayList<String> containKeys   = new ArrayList<String>();
    public HashSet<String>   containKeySet = new HashSet<String>();
    public boolean           isOpen        = false;

    public void setEntryKey(String keyType) {
        this.entryKey = keyType;
    }

    public void insertContainKeys(String keyType) {
        containKeys.add(keyType);
    }

    public boolean canBeOpenByKey(String keyType) {
        if (entryKey != null && entryKey.equals(entryKey)) {
            return true;
        }
        return false;
    }

    public void print() {
        System.out.print("index:"+index+",entryKey: " + entryKey + ", containKeys number: " + containKeys);
    }

    public String toString() {
        return "[index:"+index+",entryKey: " + entryKey + ", isopend"+ isOpen+",  containKeys number: " + containKeys+"]";
    }

}
